import siderWrapper from 'components/SiderWrapper';
import pageWrapper from 'components/PageWrapper';
import Monitor from 'components/monitor/Monitor';
import MonitorList from 'components/monitor/MonitorList';
import ProcessDesign from './processDesign/NewProcessDesign';
import ProcessRun from './processRun/ProcessRun';
import ProcessList from './processRun/ProcessList';
import Message from '../message/Message';

export default function Process({ match }) {
  const items = [{
    path: `${match.url}/design`,
    iconType: 'edit',
    text: '流程设计',
  },
  {
    path: `${match.url}/run`,
    iconType: 'unordered-list',
    text: '流程列表',
  },
  {
    path: `${match.url}/monitor`,
    iconType: 'monitor',
    text: '流程监控',
  }];
  const ProcessSider = siderWrapper(items);
  const routes = [{
    path: `${match.url}/design`,
    component: ProcessDesign,
  },
  {
    path: `${match.url}/run`,
    component: ProcessList,
  },
  {
    path: `${match.url}/run/detail`,
    component: ProcessRun,
  },
  {
    path: `${match.url}/monitor`,
    component: MonitorList,
  },
  {
    path: `${match.url}/monitor/detail`,
    component: Monitor,
  },
  {
    path: `${match.url}/message`,
    component: Message,
  }];
  return pageWrapper(ProcessSider, routes);
}
